package com.neusoft.work.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.neusoft.work.dto.BedViewDTO;
import com.neusoft.work.po.ResponseBean;
import com.neusoft.work.service.RoomInfoService;


@RequestMapping("/RoomInfoController")
@RestController
public class RoomInfoController {
    @Autowired
    private RoomInfoService roomInfoService;

    @RequestMapping("/queryRoomNumberByFloor")
    public ResponseBean<List<String>> queryRoomNumberByFloor(@RequestParam Integer floor) {
        return roomInfoService.queryRoomNumberByFloor(floor);
    }

    @RequestMapping("/queryUsageTypeByRoomNumber")
    public ResponseBean<Integer> queryUsageTypeByRoomNumber(@RequestParam String roomNumber) {
        return roomInfoService.queryUsageTypeByRoomNumber(roomNumber);
    }
    
    @GetMapping("/queryAllRoomNumber")
    public ResponseBean<List<String>> queryAllRoomNumber(){
    	return roomInfoService.queryAllRoomNumber();
    }
    
    @GetMapping("/queryAllFloors")
    public ResponseBean<List<Integer>> queryAllFloors(){
    	return roomInfoService.queryAllFloors();
    }
    
    // 床位管理界面相关接口
    @GetMapping("/getRoomsByFloor")
    public ResponseBean<List<BedViewDTO>> getRoomsByFloor(@RequestParam Integer floor) {
        return roomInfoService.getRoomsByFloor(floor);
    }
    
    @GetMapping("/getFloorStats")
    public ResponseBean<Map<String, Integer>> getFloorStats(@RequestParam Integer floor) {
        return roomInfoService.getFloorStats(floor);
    }
}
